import { httpPost, httpGet } from '@/utils/fetch'

export function getUserOpenId(params) {
  return httpGet({
    url: `/applet/user/login?code=${params.code}&StoreId=${params.StoreId}`,
    method: 'get'
  })
}

//小程序静默登录
export function appletLogin(params) {
  return httpGet({
    url: `/rich-sparrow-god/login/appletLogin`,
    method: 'get',
    params
  })
}
// //订单是否有抽奖机会


// export function getGoLottery(params) {
//   return httpPost({
//     url: '/rich-sparrow-god/myorder/getGoLottery',
//     method: 'POST',
//     data: params
//   })
// }

// 获取手机号
export function getUserPhone(params) {
  return httpPost({
    url: '/rich-sparrow-god/appletUser/setUserPhone',
    method: 'POST',
    data: params
  })
}

// 管理端-查询所有店铺
export function getAllStore(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/store/getAllStore',
    method: 'POST',
    data: params
  })
}

// 查询店铺下的房间&预约状态
export function getRoomByStoreId(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/getRoomByStoreId',
    method: 'POST',
    data: params
  })
}

// 查询店铺详情
export function getStoreDetails(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/store/getStoreDetails',
    method: 'POST',
    data: params
  })
}

// 查询房间详情
export function getRoomDetails(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/getRoomDetails',
    method: 'POST',
    data: params
  })
}

// 查询房间的当前时间未来一周的时间占用
export function getRoomWeekTime(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/getRoomWeekTime',
    method: 'POST',
    data: params
  })
}

// 预下单
export function saveOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/saveOrder',
    method: 'POST',
    data: params
  })
}

// 新增订单
export function addOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/addOrder',
    method: 'POST',
    data: params
  })
}

// 订单发起支付
export function startPay(params) {
  return httpPost({
    url: '/rich-sparrow-god/wxPay/startPay',
    method: 'POST',
    data: params
  })
}

// 钱包支付
export function walletPay(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/walletPay',
    method: 'POST',
    data: params
  })
}

// 查询我的订单分页
export function myOrderPage(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/myOrderPage',
    method: 'POST',
    data: params
  })
}

// 查询订单详情
export function getMyOrderDetails(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getMyOrderDetails',
    method: 'POST',
    data: params
  })
}

// 用户钱包金额
export function getMyWalletAmount(params) {
  return httpPost({
    url: '/rich-sparrow-god/wallet/getMyWalletAmount',
    method: 'POST',
    data: params
  })
}

// 查询充值金额列表
export function getRechargeAmountList(params) {
  return httpPost({
    url: '/rich-sparrow-god/wallet/getRechargeAmountList',
    method: 'POST',
    data: params
  })
}

// 充值
export function recharge(params) {
  return httpPost({
    url: '/rich-sparrow-god/wallet/recharge',
    method: 'POST',
    data: params
  })
}

// 发起支付
export function rechargeStartPay(params) {
  return httpPost({
    url: '/rich-sparrow-god/wxPay/rechargeStartPay',
    method: 'POST',
    data: params
  })
}

// 查询问题反馈选项
export function getFeedbackOptionsList(params) {
  return httpPost({
    url: '/rich-sparrow-god/userProblemFeedback/getFeedbackOptionsList',
    method: 'POST',
    data: params
  })
}

// 用户提交问题反馈
export function addProblemFeedback(params) {
  return httpPost({
    url: '/rich-sparrow-god/userProblemFeedback/addProblemFeedback',
    method: 'POST',
    data: params
  })
}

// 通过订单id开锁
export function orderUnLock(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/orderUnLock',
    method: 'POST',
    data: params
  })
}

// 手动取消订单
export function cancelMyOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/cancelMyOrder',
    method: 'POST',
    data: params
  })
}

// 提前结束订单
export function endUse(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/endUse',
    method: 'POST',
    data: params
  })
}

// 续单前验证
export function reorderVerify(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/reorderVerify',
    method: 'POST',
    data: params
  })
}

// 续单
export function reorder(params) {
  return httpPost({
    url: '/rich-sparrow-god/wxPay/reorder',
    method: 'POST',
    data: params
  })
}

// 提前取消发起退款
export function startBack(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/startBack',
    method: 'POST',
    data: params
  })
}

// 根据订单查询可用优惠券
export function getUserCouponByOrderPage(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getUserCouponByOrderPage',
    method: 'POST',
    data: params
  })
}

// 订单绑定优惠券
export function orderBindCoupon(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/orderBindCoupon',
    method: 'POST',
    data: params
  })
}

// 提前入场
export function earlyEntry(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/earlyEntry',
    method: 'POST',
    data: params
  })
}

// 分页查询我的优惠券
export function getUserCouponPage(params) {
  return httpPost({
    url: '/rich-sparrow-god/appletUser/getUserCouponPage',
    method: 'POST',
    data: params
  })
}

// 提前入场订单
export function entryJudge(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/entryJudge',
    method: 'POST',
    data: params
  })
}

// 根据店铺id分页查询房间
export function getRoomPageByStoreId(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/getRoomPageByStoreId',
    method: 'POST',
    data: params
  })
}

// 修改房间状态
export function stopOrStartRoom(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/stopOrStartRoom',
    method: 'POST',
    data: params
  })
}

// 管理员开房间门
export function openRoomDoor(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/openRoomDoor',
    method: 'POST',
    data: params
  })
}

// 管理员开续电器
export function openRelays(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/openRelays',
    method: 'POST',
    data: params
  })
}

// 管理员关续电器
export function closeRelays(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/closeRelays',
    method: 'POST',
    data: params
  })
}

// 查询平台协议
export function getPlatformAgreement(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/store/getPlatformAgreement',
    method: 'POST',
    data: params
  })
}

// 支付成功订单信息
export function getPaySuccessOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getPaySuccessOrder',
    method: 'POST',
    data: params
  })
}

// 用户是否已同意协议
export function getUserAgreement(params) {
  return httpPost({
    url: '/rich-sparrow-god/appletUser/getUserAgreement',
    method: 'POST',
    data: params
  })
}

// 用户同意协议
export function addUserAgreement(params) {
  return httpPost({
    url: '/rich-sparrow-god/appletUser/addUserAgreement',
    method: 'POST',
    data: params
  })
}

// 开大门锁
export function unStoreLock(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/unStoreLock',
    method: 'POST',
    data: params
  })
}

// 查询预下单
export function getFakeOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getFakeOrder',
    method: 'POST',
    data: params
  })
}

// 编辑预下单
export function updateFakeOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/updateFakeOrder',
    method: 'POST',
    data: params
  })
}

// 打扫完成
export function cleanFinish(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/cleanFinish',
    method: 'POST',
    data: params
  })
}

// 默认取消订单
export function defaultCancelOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/defaultCancelOrder',
    method: 'POST',
    data: params
  })
}

// 提前入场验证
export function earlyEntryVerify(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/earlyEntryVerify',
    method: 'POST',
    data: params
  })
}

// 查询续单详情
export function getReorderDetails(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getReorderDetails',
    method: 'POST',
    data: params
  })
}

// 续单钱包支付
export function reorderWalletPay(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/reorderWalletPay',
    method: 'POST',
    data: params
  })
}

// 卷码校验
export function receiptCheckout(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/receiptCheckout',
    method: 'POST',
    data: params
  })
}

// 验劵下单时间段验证
export function checkoutOrderTime(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/checkoutOrderTime',
    method: 'POST',
    data: params
  })
}

// 验劵下单
export function checkTheStock(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/checkTheStock',
    method: 'POST',
    data: params
  })
}

// 管理员开大门
export function openStoreDoor(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/openStoreDoor',
    method: 'POST',
    data: params
  })
}

// 模式详情
export function getMode(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getMode',
    method: 'POST',
    data: params
  })
}

// 时间段验证
export function timeSlotVerify(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/timeSlotVerify',
    method: 'POST',
    data: params
  })
}

// 获取订单退款信息
export function getOrderBack(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getOrderBack',
    method: 'POST',
    data: params
  })
}

// 订单退款
export function refund(params) {
  return httpPost({
    url: '/rich-sparrow-god/wxPay/refund',
    method: 'POST',
    data: params
  })
}

// 转增订单
export function transferOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/transferOrder',
    method: 'POST',
    data: params
  })
}

// 获取换房信息
export function getChangeRoom(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getChangeRoom',
    method: 'POST',
    data: params
  })
}

// 获取首页订单数量
export function getOrderNum(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getOrderNum',
    method: 'POST',
    data: params
  })
}

// 换房钱包信息
export function getChangeRooWallet(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getChangeRooWallet',
    method: 'POST',
    data: params
  })
}

// 换房钱包支付
export function changeRoomWalletPay(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/changeRoomWalletPay',
    method: 'POST',
    data: params
  })
}

// 换房微信支付
export function changeRoomWxPay(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/changeRoomWxPay',
    method: 'POST',
    data: params
  })
}

// 换房退款
export function changeRoomRefund(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/changeRoomRefund',
    method: 'POST',
    data: params
  })
}

// 获取个人中心信息
export function getPersonal(params) {
  return httpPost({
    url: '/rich-sparrow-god/appletUser/getPersonal',
    method: 'POST',
    data: params
  })
}

// 获取用户会员等级
export function getUserVipLevel(params) {
  return httpPost({
    url: '/rich-sparrow-god/appletUser/getUserVipLevel',
    method: 'POST',
    data: params
  })
}

// 新增合作加盟
export function addCooperate(params) {
  return httpPost({
    url: '/rich-sparrow-god/cooperate/addCooperate',
    method: 'POST',
    data: params
  })
}

// 所搜附近的店铺
export function searchNearby(params) {
  return httpPost({
    url: '/rich-sparrow-god/homePage/searchNearby',
    method: 'POST',
    data: params
  })
}

// 查询免费领取优惠券
export function getForFreeCoupon(params) {
  return httpPost({
    url: '/rich-sparrow-god/appletUser/getForFreeCoupon',
    method: 'POST',
    data: params
  })
}

// 领取优惠券
export function getCoupon(params) {
  return httpPost({
    url: '/rich-sparrow-god/appletUser/getCoupon',
    method: 'POST',
    data: params
  })
}

// 查询已上架的活动
export function getUpActivity(params) {
  return httpPost({
    url: '/rich-sparrow-god/homePage/getUpActivity',
    method: 'POST',
    data: params
  })
}

// 分页查询卡券
export function getCardCouponPage(params) {
  return httpPost({
    url: '/rich-sparrow-god/userStarValue/getCardCouponPage',
    method: 'POST',
    data: params
  })
}

// 分页查询用户卡券
export function getUserCardCouponPage(params) {
  return httpPost({
    url: '/rich-sparrow-god/userStarValue/getUserCardCouponPage',
    method: 'POST',
    data: params
  })
}

// 获取用户攒星日期
export function getUserStarRecord(params) {
  return httpPost({
    url: '/rich-sparrow-god/userStarValue/getUserStarRecord',
    method: 'POST',
    data: params
  })
}

// 用户兑换优惠券
export function userGetCardCoupon(params) {
  return httpPost({
    url: '/rich-sparrow-god/userStarValue/userGetCardCoupon',
    method: 'POST',
    data: params
  })
}

// 查询卡券可用房间
export function getCardCouponRoom(params) {
  return httpPost({
    url: '/rich-sparrow-god/userStarValue/getCardCouponRoom',
    method: 'POST',
    data: params
  })
}

// 卡券下单
export function cardCouponToOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/userStarValue/cardCouponToOrder',
    method: 'POST',
    data: params
  })
}

// 查询活动详情
export function getActivityDetails(params) {
  return httpPost({
    url: '/rich-sparrow-god/homePage/getActivityDetails',
    method: 'POST',
    data: params
  })
}

// 领取活动优惠券
export function getActivityStuff(params) {
  return httpPost({
    url: '/rich-sparrow-god/homePage/getActivityStuff',
    method: 'POST',
    data: params
  })
}

// 查询推荐的活动
export function getSuggestActivity(params) {
  return httpPost({
    url: '/rich-sparrow-god/homePage/getSuggestActivity',
    method: 'POST',
    data: params
  })
}

// 提交返券申请
export function addRebate(params) {
  return httpPost({
    url: '/rich-sparrow-god/rebate/addRebate',
    method: 'POST',
    data: params
  })
}

// 查询团购订单
export function getGroupOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getGroupOrder',
    method: 'POST',
    data: params
  })
}

// 扫码续单详情
export function scanCodeReorder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/scanCodeReorder',
    method: 'POST',
    data: params
  })
}

// 查询卡券列表
export function grtCardCouponList(params) {
  return httpPost({
    url: '/rich-sparrow-god/homePage/grtCardCouponList',
    method: 'POST',
    data: params
  })
}

// 卡券详情
export function getCardCouponDetails(params) {
  return httpPost({
    url: '/rich-sparrow-god/userStarValue/getCardCouponDetails',
    method: 'POST',
    data: params
  })
}

// 新增卡券订单
export function addCardCouponRecord(params) {
  return httpPost({
    url: '/rich-sparrow-god/userCardCoupon/addCardCouponRecord',
    method: 'POST',
    data: params
  })
}

// 购买卡券发起支付
export function getCardCouponStartPay(params) {
  return httpPost({
    url: '/rich-sparrow-god/wxPay/cardCouponStartPay',
    method: 'POST',
    data: params
  })
}

// 查询空闲数量
export function getFreeCount(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/getFreeCount',
    method: 'POST',
    data: params
  })
}

// 查询用户加时卡
export function getUserExtraTimeCard(params) {
  return httpPost({
    url: '/rich-sparrow-god/homePage/getUserExtraTimeCard',
    method: 'POST',
    data: params
  })
}

// 转增加时卡
export function transferExtraTimeCard(params) {
  return httpPost({
    url: '/rich-sparrow-god/userExtraTimeCard/transferExtraTimeCard',
    method: 'POST',
    data: params
  })
}

// 使用加时卡
export function useExtraTimeCard(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/useExtraTimeCard',
    method: 'POST',
    data: params
  })
}

// 续费时间列表
export function getReorderTimeList(params) {
  return httpPost({
    url: '/rich-sparrow-god/reorderTime/getReorderTimeList',
    method: 'POST',
    data: params
  })
}

// 用户加时卡列表
export function getUserExtraTimeCardList(params) {
  return httpPost({
    url: '/rich-sparrow-god/userExtraTimeCard/getUserExtraTimeCardList',
    method: 'POST',
    data: params
  })
}

// 奖品列表
export function getPrizeList(params) {
  return httpPost({
    url: '/rich-sparrow-god/lottery/getPrizeList',
    method: 'POST',
    data: params
  })
}

// 抽奖
export function getDrawOnce(params) {
  return httpPost({
    url: '/rich-sparrow-god/lottery/drawOnce',
    method: 'POST',
    data: params
  })
}


// 抽奖
export function getLotteryRecordList(params) {
  return httpPost({
    url: '/rich-sparrow-god/lottery/getLotteryRecordList',
    method: 'POST',
    data: params
  })
}

// 订单是否有抽奖机会
export function getGoLottery(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getGoLottery',
    method: 'POST',
    data: params
  })
}

// 查询商品类型
export function getGoodsTypeList(params) {
  return httpPost({
    url: '/rich-sparrow-god/goodsUser/getGoodsTypeList',
    method: 'POST',
    data: params
  })
}

// 分页查询商品
export function getGoodsPage(params) {
  return httpPost({
    url: '/rich-sparrow-god/goodsUser/getGoodsPage',
    method: 'POST',
    data: params
  })
}

// 用户选择商品
export function selectedGoods(params) {
  return httpPost({
    url: '/rich-sparrow-god/goodsUser/selectedGoods',
    method: 'POST',
    data: params
  })
}

// 查询用户已选择的商品
export function getSelectedGoods(params) {
  return httpPost({
    url: '/rich-sparrow-god/goodsUser/getSelectedGoods',
    method: 'POST',
    data: params
  })
}

// 选好了
export function lockStock(params) {
  return httpPost({
    url: '/rich-sparrow-god/goodsUser/lockStock',
    method: 'POST',
    data: params
  })
}

// 查询房间分类
export function getRoomTypeList(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/getRoomTypeList',
    method: 'POST',
    data: params
  })
}